Skip to content

Conversation

@Lagrang3
Copy link
Collaborator

Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list.

Solves issue #7953

Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list.

Reported-by: @hMsats
Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the xpay-handle-null-params branch from c1a5c6e to 9e1f00b Compare December 19, 2024 09:59
Changelog-None: xpay-handle-pay: don't assume bolt11 param is non NULL

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3
Copy link
Collaborator Author

Lagrang3 commented Dec 19, 2024

I tested this with netcat command through the naked lightning-rpc socket.
eg.

echo "{\"jsonrpc\":\"2.0\",\"id\":\"nc\",\"method\":\"pay\",\"params\":[\"lnbcrt...\",null]}" | nc -U /tmp/l1/regtest/lightning-rpc

I don't know if we have the tools to test this with the current pyln library.

UPD. Yes we can test it. I am adding regtests for this.

Changelog-None: xpay-handle-pay: test null params in json array.

Signed-off-by: Lagrang3 <[email protected]>
@rustyrussell
Copy link
Contributor

Nice catch! We generally use dicts for param passing (it's just better for almost so uses), so I forgot about this corner case!

@chrisguida
Copy link
Contributor

Hoping this fixes Zeus Wallet!

ZeusLN/zeus#2609

@Lagrang3 Lagrang3 added this to the v25.02 milestone Feb 6, 2025
@endothermicdev
Copy link
Collaborator

Looks good and thanks for adding the test.

ACK 4470fa3

@endothermicdev endothermicdev merged commit 3f2b490 into ElementsProject:master Feb 6, 2025
33 of 39 checks passed
@Lagrang3 Lagrang3 deleted the xpay-handle-null-params branch February 12, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants